{
 "cells": [
  {
   "cell_type": "markdown",
   "source": [
    "本文目的是为了在离线环境中部署训练的环境"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "进入到YOLOv8源码中,使用指令下载包:\\\n",
    "pip download -r requirements.txt -d \"./dependencies\"\n",
    "pip3 download torch torchvision torchaudio \\--index-url https://download.pytorch.org/whl/cu118 -d \"./dependencies\""
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "删除里面的cpu的torch torchvision,将YOLOv8源码的requirements.txt复制到dependencies文件夹,并增加torchaudio,打包dependencies文件夹"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "复制到目的地位置并解压缩,进入文件夹,执行:\\\n",
    "pip install \\--no-index -f ./ -r requirements.txt\n",
    "\n",
    "\n",
    "注: --no-index取消去http检索,-f 是指定安装包位置"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "进入到下载的源码,使用源码安装YOLOv8,在每次更改源码后,需要重启下python解释器(DataShell中,Environment->Stop Jupyter Server): pip install -e F:\\Project\\DeepLearning\\YOLOv8\\ultralytics"
   ],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
